{% load i18n %}
<div class="pagination">

    <script type="text/javascript">
        function jumpto() {
            var userInput=prompt('{% trans "Enter page number" %}','{{ page.number }}');
            if (userInput != '' && userInput != null) {
                location.href = '?page='+userInput;
            }
        }
    </script>

    {% comment %}
    <span class="summary">
        {{ label }}
        {{ page.start_index }}&mdash;{{ page.end_index }}
        {% trans "of" %} {{ page.paginator.count }}
    </span>
    {% endcomment %}

    {% if page.has_other_pages %}
        {#&bull;#}

        <span class="pages-of" onclick="jumpto(); return false;" title="{% trans 'Go to page...' %}">
            {% trans "Page" %} {{ page.number }}
            {% trans "of" %} {{ page.paginator.num_pages }}
        </span>

        &bull;

        {% if 1 < page.paginator.frame_start_page %}
        {% if page.first_page_url %}
        <a href="{{ page.first_page_url }}">1</a>
        <span>&#133;</span>
        {% endif %}
        {% endif %}

        {% for xpage, xurl in page.paginator.frame %}
        {% ifequal page.number xpage %}
        <span class="current">{{ page.number }}</span>
        {% else %}
        <a href="{{ xurl }}">{{ xpage }}</a>
        {% endifequal %}
        {% endfor %}

        {% if page.paginator.num_pages > page.paginator.frame_end_page %}
        {% if page.last_page_url %}
        <span>&#133;</span>
        <a href="{{ page.last_page_url }}">{{ page.paginator.num_pages }}</a>
        {% endif %}
        {% endif %}

    {% endif %}

</div>
